home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / GRPHDFLT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  911 b   |  30 lines

  1. /* graphdefaults  */
  2. #include <stdio.h>
  3. #include <graphics.h>
  4.  
  5. main()
  6. {
  7.     int graphdriver = DETECT,graphmode;
  8.     struct viewporttype cur_view;
  9.     char buffer[80];
  10. /*  Initialize the graphics system */
  11.     initgraph(&graphdriver,&graphmode,"c:\\turboc");
  12.     outtextxy(10,20,"Demonstrating graphdefaults");
  13. /*  Define a viewport with clipping ON */
  14.     setviewport(10,100,300,300,1);
  15. /*  Select colors and line style */
  16.     setcolor(RED);
  17.     setlinestyle(DASHED_LINE,0,THICK_WIDTH);
  18. /*  Draw a line from (10,50) to (getmaxx(),50) to
  19.     illustrate the viewpoint */
  20.     line(10,50,getmaxx(),50);
  21. /*   Now revert to default settings  */
  22.     outtextxy(10,20,"Press a key to call graphdefaults");
  23.     getch();
  24.     graphdefaults();
  25. /*   Repeat previous line drawing command to show result */
  26.     line(10,50,getmaxx(),50);
  27.     outtextxy(10,270,"Press any key to exit:");
  28.     getch();
  29.     closegraph(); /* Close graphics system */
  30. }